package com.java1234.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.java1234.entity.ProjectProgress;
import com.java1234.mapper.ProjectProgressMapper;
import com.java1234.service.ProjectProgressService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 项目进度汇报表 服务实现类
 * </p>
 *
 * @author zhai
 * @since 2025-05-10
 */
@Service
public class ProjectProgressServiceImpl extends ServiceImpl<ProjectProgressMapper, ProjectProgress> implements ProjectProgressService {


    @Override
    public boolean checkMonthlySubmission(Integer userId, Integer month) {
        LambdaQueryWrapper<ProjectProgress> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(ProjectProgress::getUserid, userId)
                .eq(ProjectProgress::getScoreMonth, month);
        return this.count(wrapper) > 0;
    }

}
